DEFINITION MODULE DOS;

FROM SYSTEM IMPORT ADDRESS;

CONST
 offsetBeginning = 0;
 offsetCurrent   = 1;
 offsetEnd       = 2;

TYPE
 FileHandle = RECORD
  handle  : INTEGER;
  name    : ARRAY [0..29] OF CHAR;
  tempNum : CARDINAL;
 END (* RECORD *);

 FileHandlePtr = POINTER TO FileHandle;

PROCEDURE OpenTemporaryFile() : FileHandlePtr;
PROCEDURE CloseTemporaryFile(file : FileHandlePtr);

PROCEDURE WriteFile(file : FileHandlePtr;
                    data : ADDRESS;
                    len  : CARDINAL) : CARDINAL;

PROCEDURE ReadFile(file : FileHandlePtr;
                   data : ADDRESS;
                   len  : CARDINAL) : CARDINAL;

PROCEDURE SeekFile(file : FileHandlePtr;
               pos      : LONGCARD;
               mode     : CARDINAL);

END DOS.